<link rel="stylesheet" href="<?php echo STATIC_URL.'/backend/css/notice.css'?>" />
<?php $this->load->view('templates/backend/lib'); ?>
<script>
function closeFancy(){
    parent.jQuery.fancybox.close();
}
function sending(){
    $("#submit").attr('disabled','disabled');
    $("#cancel").attr('disabled','disabled');
    $("#success").html("<img src='<?php echo STATIC_URL;?>/backend/images/icon/loading-2.gif' /> <br/> Vui lòng chờ");    
    setTimeout(function () {
        $.ajax(
            {
                url : '/auth/bookhistory/noteFly',
                type: "POST",
                data : { booking_place_code: $("#booking_place_code").val(),airline: $("#airline").val(),session_vb: $("#session_vb").val(),note:$("#note").val()},
                cache: true,
                beforeSend: function(){
                    $("#success").html("<img src='<?php echo STATIC_URL;?>/backend/images/icon/loading-2.gif' /> <br/> Đang xử lí");
                },
                success:function(data)
                {
                    setTimeout(function () {
                        if(data==1){
                                $("#success").html("Luu thành công!");
                                setTimeout(function () {
                                    closeFancy();
                                },1000);
                                
                        } else {
                            $("#success").html("Luu thất bại!");
                        }
                    },2000);
                },
                error: function() 
                {
                    $("#success").html("Duyệt booking thất bại!");
                }
            });
     },2000);
    
    
}
</script>

<div id="container2">
    <h3 id="nav2" class="logo">
        <a id="logo">GHI CHÚ</a>
    </h3>
    
    <div id="wufoo-mz9i3ib0wkzqls">
        <p style="text-align: center;">BOOKER NẾU CÓ THAY ĐỔI THÔNG TIN GIỜ BAY, NGÀY BAY... <br/>THÌ NOTE LẠI HẾT VÀO ĐÂY</p>
        <ul>
            <li><?php
                    echo form_textarea(array('name' => 'note', 'id' => 'note','value'=>$note,'cols'=>'50','rows'=>'10'));
                ?></li>
        </ul>
        <?php echo form_input(array('type'=>'hidden', 'name' => 'session_vb', 'id' => 'session_vb', 'value' => md5(time())));?>
        <?php echo form_input(array('type'=>'hidden', 'name' => 'booking_place_code', 'id'=>'booking_place_code', 'value' => $info[0]->booking_place_code));?>
        <?php echo form_input(array('type'=>'hidden', 'name' => 'airline', 'id'=>'airline', 'value' => $info[0]->airline));?>
        <div class="top-button">
                <?php echo form_button(array('id' => 'submit', 'name' => 'submit', 'content' => $this->lang->line('save'),'class' => 'btn btn-primary','onclick'=>'sending()')); ?>
                <?php echo form_button(array('id' => 'cancel','content' => $this->lang->line('close'),'class' => 'btn','onclick'=>'closeFancy()')); ?>
        </div>
        <div id="success"></div>
    </div>
</div>
